
/*api路由列表*/

"use strict";
var express = require("express");
var router = express.Router();
var userApi = require("../api/user");

const { getUserInfo, testApi } = userApi;

//设置路由方法

const commRouterSet = (routerName, callback) => {
  return (
    router.use(`/${routerName}`, (req, res) => {
      callback(req, res);
    })
  )
}

//路由列表

const routerList = [

  commRouterSet("getUserInfo", getUserInfo),  //获取用户信息

  commRouterSet("testApi", testApi),  //示例接口

]

module.exports = routerList;
